# Reading in data
load("Mussel.Rdata")
library(emmeans)

source("OA_example_functions.R")


# Table 1 - Large mussel 
MA(response = Glengthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "aov")
MA(response = Glengthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "lmer")

MA(response = Gwidthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "aov")
MA(response = Gwidthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "lmer")

MA(response = SWSL, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "aov")
MA(response = SWSL, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "lmer")

MA(response = FWSW, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "aov")
MA(response = FWSW, wholeplot = year, subplot = substrate, 
   wpID = header, data = Large, method = "lmer")

# Table 1 - Small mussel 
MA(response = Glengthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "aov")
MA(response = Glengthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "lmer")

MA(response = Gwidthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "aov")

MA(response = Gwidthpercent, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "lmer")

MA(response = SWSL, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "aov")
MA(response = SWSL, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "lmer")

MA(response = FWSW, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "aov")
MA(response = FWSW, wholeplot = year, subplot = substrate, 
   wpID = header, data = Small, method = "lmer")
